<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
	<head>
		<meta charset="utf-8">
		<title>全站账号检查</title>
		<script src="../static/js/jquery-3.3.1.min.js"></script>
		<script src="../static/js/bootstrap.min.js"></script>
		<link href="../static/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
		<style>
			.page-header h3{
				font-weight: 800;
			}
		</style>

		<script>
			$(document).ready(function () {
				$('.checkBtn').click(function () {
					$.post(
							"${pageContext.request.contextPath}/checkUser",
							$("#checkUserForm").serialize(),
							function (data) {
								if(data==0){
									alert("无此用户");
								}else{
									var $url = "${pageContext.request.contextPath}" +'/jsp/modifyPassword.jsp';
									$(window).attr('location',$url);
								}
							}
					);
				});

				$('.index').click(function () {
					var $url = "${pageContext.request.contextPath}" +'/index.jsp';
					$(window).attr('location',$url);
				});
			});
		</script>

	</head>
	<body background="../static/img/bg.png">
		<div class="contains" style="width: 50%;  margin: 200px auto;">
			<div class="check text-center"><img src="../static/img/logo.png" width="200px" /></div>

			<div class="check">
				<script>
					$('.check').show();
				</script>
				<div class="panel panel-collapse panel-primary text-center">
					<div class="page-header panel-danger">
						<h3 class="text-info">请输入您的账号以及姓名</h3>
					</div>
					<div class="panel-body text-center">
						<form class="form form-horizontal" id="checkUserForm">
							<div class="form-group form-inline">
								<%--http://localhost:8080/Online_Selection_Course_war_exploded/checkUser?userid=126&userName=admin--%>

								<label>账号：<input type="text" class="form-control" name="userId" placeholder="请输入账号" /></label>
								<label class="tip userTip text-danger"></label>
							</div>
							<div class="form-group form-inline">
								<label>姓名：<input type="text" class="form-control" name="userName" placeholder="请输入姓名" /></label>
								<label class="tip nameTip text-danger"></label>
							</div>
							<div class="form-group form-inline">
								<button type="button" class="btn btn-info  checkBtn">确定</button>
								<button type="button" class="btn btn-danger index">主页</button>
								<label class="tip statusTip text-danger"></label>
							</div>
						</form>
					</div>
					<div class="panel-footer ">
						<h5>@2019-2020 JSP期末项目</h5>
					</div>

				</div>
			</div>
		</div>

	</body>
</html>
